package conf
import (
	"github.com/spf13/viper"
	"go.uber.org/zap"
)

// InventorySection map toml [inventory]
type InventorySection struct {
	Host string
	Port string
}

// ReadInventory get inventory section from config
func ReadInventory (v *viper.Viper, slog *zap.SugaredLogger) (inventoryConf InventorySection) {
	err := v.Unmarshal(&inventoryConf)
	if err != nil {
		slog.Panicf("unable to decode into inventory section, %v", err)
	}
	slog.Debug(inventoryConf)
	return
}